﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;

namespace hzGis.service.impl
{
   public class MapToolService
    {
        /// <summary>
        /// 将地图与布局之间拷贝
        /// </summary>
       public object CopyToPageLayout(AxMapControl axMapControl, AxPageLayoutControl axPageLayoutControl)
        {
            IObjectCopy pObjectCopy = new ObjectCopy();
            object copyFromMap = axMapControl.Map;
            object copiedMap = pObjectCopy.Copy(copyFromMap);//复制地图到copiedMap中
            object copyToMap = axPageLayoutControl.ActiveView.FocusMap;
            pObjectCopy.Overwrite(copiedMap, ref copyToMap); //复制地图
            axPageLayoutControl.ActiveView.Refresh();
            return copyToMap;
        }
    }
}
